package com.orcamento.entity.enums;

public enum InvoiceStatusEnum {
	 ABERTO, FECHADO, PAGO;

	public static InvoiceStatusEnum findByName(String name) {
		if( name == null ) {
			return InvoiceStatusEnum.ABERTO;
		}
		
		for( InvoiceStatusEnum status : values() ) {
			if( status.name().equals( name.toUpperCase() ) ) {
				return status;
			}
		}
		
		return InvoiceStatusEnum.ABERTO;
	}
}
